import java.util.Scanner;
import java.util.Random;

public class Demo1 {
    public static void main(String[] args) {
        Random r = new Random();
        Scanner sc = new Scanner(System.in);
        int randomNum = r.nextInt(100) + 1;
        while (true) {
            System.out.println("请输入您要猜的数字:");
            int num = sc.nextInt();
            if (num > randomNum) {
                System.out.println("您猜大了");
            } else if (num < randomNum) {
                System.out.println("您猜小了");
            } else {
                System.out.println("恭喜,猜中了");
                break;
            }
        }
        System.out.println("感谢您的使用");
    }
}
